package com.learn.thread;

import cn.hutool.core.thread.ThreadFactoryBuilder;
import org.apache.commons.lang3.concurrent.BasicThreadFactory;

import java.util.concurrent.*;

/**
 * @version 1.0
 * @author: CRM_SYSTEM
 * @date: 2023/3/8 22:45
 * @Description:
 */
public class ThreadExecutor {
//    public static void main(String[] args) {
////        推荐方式 1 首先引入：commons-lang3包
//        ScheduledThreadPoolExecutor scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor(1,
//                new BasicThreadFactory.Builder().namingPattern("example-schedule-pool-%d")))
//
////        推荐方式 2 首先引入：com.google.guava包
//        ThreadFactory factory = new ThreadFactoryBuilder().setNamePrefix("demo-pool-%d").build();
//        ExecutorService pool = new ThreadPoolExecutor(5, 200, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(1024), factory, new ThreadPoolExecutor.AbortPolicy());
//
//    }
}
